package com.lxf.cloudotherserve.bean;

import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.DateFormat;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.io.Serializable;

/**
 * @author 罗兴发
 * @data 2025/6/27 17:14
 * @description：浏览记录-实体类
 */
@Data
@Accessors(chain = false)  //链式结构
@NoArgsConstructor   //无参构造函数
@Document(indexName = "es") //创建的es库名称
public class PlayHistoryBean implements Serializable {
    private static final long serialVersionUID = 1L;//控制序列化版本兼容
    @Id
    @Field(type = FieldType.Integer)
    private Integer phId;//表ID

    @Field(type = FieldType.Integer)
    private Integer phType;//浏览记录类型：0商品 其他待定

    @Field(type = FieldType.Text)
    private String objId;//浏览对象ID

    @Field(type = FieldType.Text)
    private String objTitle;//浏览对象标题

    @Field(type = FieldType.Text)
    private String objImage;//浏览对象的图片

    @Field(type = FieldType.Integer)
    private Integer userId;//浏览用户ID

    @Field(type = FieldType.Integer)
    private Integer commentNum;//浏览对象的评论量

    @Field(type = FieldType.Integer)
    private Integer likeNum;//浏览对象的点赞量

    @Field(type = FieldType.Date, format = DateFormat.basic_date_time)
    private String addTime;//浏览时间
}
